package cn.com.lei.du.service.impl;

import cn.com.lei.du.entity.User;
import cn.com.lei.du.service.UserService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class UserServiceFallbackFactory implements FallbackFactory<UserService> {

    @Override
    public UserService create(Throwable cause) {
        return new UserService() {
            @Override
            public User getUser() {
                return null;
            }

            @Override
            public User getUserParam(String name) {
                return null;
            }

            @Override
            public User getUserHeader(String name) {
                return null;
            }

            @Override
            public User getUserBody(User user) {
                return null;
            }

            @Override
            public User getUserPath(String name) {
                return null;
            }

            @Override
            public User getUserRetry() {
                return null;
            }

            @Override
            public User getUserHys() {
                log.info("fall back fastory--->");
                return new User();
            }
        };
    }
}
